import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home/my'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/YouLogin.vue')
    },
    {
      path: '/home',
      name: 'Home',
      component: () => import('@/views/home/HomeView.vue'),
      children: [
        {
          path: 'my',
          name: 'My',
          component: () => import('@/views/home/MyVite.vue')
        },
        {
          path: 'user',
          name: 'User',
          component: () => import('@/views/home/UserVite.vue')
        },
        {
          path: 'about',
          name: 'About',
          component: () => import('@/views/home/AboutView.vue')
        }
      ]
    },
    {
      path: '/:catchAll(.*)',
      name: '404',
      component: () => import('@/views/404.vue')
    }
  ]
})

export default router
